# 查询系统

yhlb=["mary","harry","mike","tom","rose"]
mmlb=["123456","888888","999999","765432","678901"]
print("""请选择
1 用户增加
2 用户删除
3 用户查询
4 查看数据,退出系统""")

functionIndex = eval(input("请输入"))
while functionIndex != 4:
    if functionIndex == 1:
        user = input("请输入用户名")
        password = input("请输入密码")
        if yhlb.count(user) != 0:
            print("用户已经存在 无法增加")
        else:
            yhlb.append(user)
            mmlb.append(password)
            print("用户已增加")
    if functionIndex == 2:
        user = input("请输入用户名")
        if yhlb.count(user) == 0:
            print("用户不存在 无法删除")
        else:
            for i in range(len(yhlb)):
                if yhlb[i] == user:
                    del yhlb[i]
                    del mmlb[i]
                    print("用户已删除")
                    break
    if functionIndex == 3:
        user = input("请输入用户名")
        if yhlb.count(user) == 0:
            print("用户不存在")
        else:
            for i in range(len(yhlb)):
                if yhlb[i] == user:
                    print("密码{}".format(mmlb[i]))
                    break
    functionIndex = eval(input("请输入"))

for i in range(len(yhlb)):
    print("用户名{:6}密码{:6}".format(yhlb[i], mmlb[i]))